﻿<script type="text/javascript">
    $(document).ready(function () {
        var p = new singlepage();
        p.c = "Way.Bus.WMS.ST.Controllers.InOrder.ReceiveOrderController";
        p.applyTo = "t1";
       
        p.onGridAddOrEdit = function (grid, cmd, item, ischild) {
            if (ischild) {
                if (cmd == "add")
                    return false;
                if (cmd == "edit") {
                    return item.SEQUENCECODE;
                }
            }
        }
        p.onFromValChange = function (from, item, isgridfrom) {
            if (isgridfrom) {
                var grid = from.findgrid("Way.Bus.WMS.Model.InSequence");
                if (item.SEQUENCECODE != undefined)
                    grid.setdisabled(!item.SEQUENCECODE);

            }
        }
        p.init();
    });

    function emport4(data) {
        data.source.reload();
        $('<div id="d2"><div id="d3"/></div>').appendTo($("#temp"));
        var p2 = new singlepage();
        p2.c = "Way.Bus.Controllers.ExcelDCController";
        p2.applyTo = "d3";
        //p1.outc = form.parent.c;
        //p1.ssss = data;
        window.ddata = data;
        window.pdata = p2;
        p2.init();
        $('#d2').dialog({
            title: "导出数据",
            collapsible: false,
            width: 400,
            height: 320,
            cache: false,
            href: p2.datasource.url,
            onClose: function () {
                $(this).panel('destroy');
                $("#temp").empty();
                window.ddata = null;
            }
        });
    }
</script>
<div id="t1"></div>
